Skip to content

Conversation

@anny-lanai
Copy link

Remove unnecessary alias in webpack. Tested locally to work.

Remove unnecessary alias in webpack. Tested locally to work.
@anny-lanai anny-lanai closed this Aug 20, 2025
@anny-lanai anny-lanai reopened this Aug 20, 2025
@vindex10
Copy link

vindex10 commented Nov 2, 2025

Hi! I just came to thumbs up. The alias is not needed because transformers.js does resolution in its package.json:
https://github.com/huggingface/transformers.js/blob/4c908ec898f85510ccbc989b76faa3e2705c1461/package.json#L8-L23

The alias as it is now - is incorrect, because it points to the node.js version of transformers js. It consequently imports sharp and onnxruntime-node and other irrelevant stuff.

The correct alias would be as below. But again - this resolution happens automatically - so the alias can indeed be removed.

    alias: {
      "@huggingface/transformers": path.resolve(
        __dirname,
        "node_modules/@huggingface/transformers/dist/transformers.web.js",
      ),
    },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants